﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="OrderHistory.aspx.cs" Inherits="Sale_OrderHistory" Title="销售订单历史" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table>
    <tr>
        <td>
            <asp:GridView ID="GridViewOrders" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="OrderID" DataSourceID="SQLDatasource" ForeColor="Black" GridLines="Vertical" OnRowCommand="GridViewOrders_RowCommand">
                <FooterStyle BackColor="#CCCC99" />
                <Columns>
                    <asp:BoundField DataField="OrderID" HeaderText="订单ID" InsertVisible="False" ReadOnly="True"
                        SortExpression="OrderID" />
                    <asp:BoundField DataField="OrderNumber" HeaderText="订单号" SortExpression="OrderNumber" />
                    <asp:BoundField DataField="CustomerName" HeaderText="客户" SortExpression="CustomerName" />
                    <asp:BoundField DataField="Sum" HeaderText="总价" SortExpression="Sum" />
                    <asp:BoundField DataField="OrderDate" HeaderText="日期" SortExpression="OrderDate" />
                    <asp:BoundField DataField="SalerName" HeaderText="销售" SortExpression="SalerName" />
                    <asp:BoundField DataField="Comment" HeaderText="备注" SortExpression="Comment" />
                    <asp:ButtonField ButtonType="Button" CommandName="DeleteOrder" Text="删除" />
                    <asp:ButtonField ButtonType="Button" CommandName="ViewEdit" Text="查看/修改" />
                </Columns>
                <RowStyle BackColor="#F7F7DE" />
                <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" />
                
            </asp:GridView>
            <asp:SqlDataSource ID="SQLDatasource" runat="server" ConnectionString="<%$ ConnectionStrings:DBConnectionString %>"
                SelectCommand="SELECT OrderID, OrderNumber, CustomerName, Sum, OrderDate, SalerName, Comment FROM tbl_Orders order by OrderDate desc">
            </asp:SqlDataSource>
        </td>
    </tr>
</table>
</asp:Content>

